const mysql = require('mysql2');

const {database} = require('./../utils/config')

const db = mysql.createConnection({
    host: database.host,
    user: database.username,
    password: database.password,
    database : database.database
});

module.exports = db



//**//

// db.execute(
//     'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',
//     ['Rick C-137', 53],
//     function(err, results, fields) {
//         if(err) return err.message
//     }
// );

// db.query(
//     'SELECT * FROM `table` WHERE `name` = ? AND `age` > ?',
//     ['Page', 45],
//     function(err, results) {
//         console.log(results);
//     }
// );

//**//